package com.redsoft.spirit.util;

import java.util.Map;

import com.redsoft.spirit.service.AccountService;
import com.redsoft.spirit.service.AuthorizationService;

/**
 * 为数据权限做的工具类，可以为sql拼接数据权限的sql.
 * 
 * <pre>
 * 	为数据权限做的工具类，可以为sql拼接数据权限的sql
 * </pre>
 * 
 * @author 杨雷
 * @since 1.0
 */
public class AuthDataHandler {

	public static AuthorizationService getAuthService() {
		return SpringContextHolder.getBean(AuthorizationService.class);
	}

	public AccountService getAccountService() {
		return SpringContextHolder.getBean(AccountService.class);
	}

	public static void setAuthDataSql(String userId, StringBuilder sql, StringBuilder countSql, Map map) {
		getAuthService().getAuthSql(userId, sql, countSql, map);
	}
}
